import fs from 'fs'
import { resolve } from 'path'

function readFileAsync(path) {
  return new Promise(function (resolve) {
    fs.readFile(path, {encoding:'utf8', flag:'r'}, function (err, result) {
      if (err) {
        console.log(err)
      } else {
        resolve(result) 
      }
    })
  })
}

export const getVideos = async (id) => {
  let prefix = './server/videos/videoinfo/'
  const pages = require(resolve(prefix, `3001.js`))
  let data = {}
  console.log('pages(id)')
  console.log(pages(id))
  data = {
    ...pages(id)
  }

  return data
}



